package com.huawei.fastengine.fastview.download.download;

import android.os.Bundle;
import android.os.Message;
import android.util.Log;
import com.huawei.fastengine.fastview.download.utils.log.FastViewLogUtils;
import java.io.File;
import java.io.IOException;

class HiappDownloadActivity$2 implements DownloadListener {
    final /* synthetic */ HiappDownloadActivity this$0;

    HiappDownloadActivity$2(HiappDownloadActivity hiappDownloadActivity) {
        this.this$0 = hiappDownloadActivity;
    }

    public void failure(int i) {
        Log.e("HiappDownloadActivity", "DownloadManager failure code " + i);
        if (4 != i) {
            Message message = new Message();
            message.what = 4;
            HiappDownloadActivity.access$100(this.this$0).sendMessage(message);
        }
    }

    public void progress(int i, int i2) {
        FastViewLogUtils.e("DownloadManager progress,", i + "/" + i2);
        Message message = new Message();
        message.what = 1;
        message.arg1 = i;
        message.arg2 = i2;
        HiappDownloadActivity.access$100(this.this$0).sendMessage(message);
    }

    public void success(File file) {
        Log.i("HiappDownloadActivity", "DownloadManager success");
        HiappDownloadActivity.access$702(this.this$0, file);
        Message message = new Message();
        message.what = 3;
        Bundle bundle = new Bundle();
        String str = null;
        try {
            str = file.getCanonicalPath();
        } catch (IOException e) {
            FastViewLogUtils.e("HiappDownloadActivity", "getCanonicalPath exception");
        }
        String str2 = "path";
        if (str == null) {
            str = "";
        }
        bundle.putString(str2, str);
        message.setData(bundle);
        HiappDownloadActivity.access$100(this.this$0).sendMessage(message);
    }
}
